﻿package mortal.game.control
{
    import Framework.MQ.*;
    import Message.Command.*;
    import Message.DB.Tables.*;
    import Message.Public.*;
    import com.gengine.core.frame.*;
    import com.gengine.global.*;
    import com.gengine.keyBoard.*;
    import com.mui.controls.*;
    import com.mui.utils.*;
    import extend.language.*;
    import flash.display.*;
    import mortal.common.*;
    import mortal.component.gconst.*;
    import mortal.game.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.game.scene3D.ai.*;
    import mortal.game.scene3D.map3D.util.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.utils.*;
    import mortal.game.view.arena.util.*;
    import mortal.game.view.arena.view.*;
    import mortal.game.view.common.*;
    import mortal.game.view.copy.*;
    import mortal.game.view.copy.groupCopy.data.*;
    import mortal.game.view.heroArena.util.*;
    import mortal.game.view.heroArena.view.*;
    import mortal.game.view.systemSetting.*;
    import mortal.game.view.task.drama.operations.*;
    import mortal.mvc.core.*;

    public class HeroArenaController extends CopyControllerBase
    {
        private var _isInArena:Boolean;
        private var _isWatching:Boolean;
        private var _isArenaOpen:Boolean;
        private var _isArenaClose:Boolean;
        private var _isArenaBegin:Boolean;
        private var _isArenaEnd:Boolean;
        private var _isMatching:Boolean;
        private var _isMatchSucc:Boolean;
        private var _isObserver:Boolean;
        private var _isNeedPopupSignUpWin:Boolean;
        private var _isInCountDown:Boolean;
        private var _isLimited:Boolean;
        private var _arenaStartTime:Number;
        private var _arenaEndTime:Number;
        private var _secTimer:SecTimer;
        private var _secTimer2:SecTimer;
        private var _alertWin:Sprite;
        private var _frameTimer:FrameTimer;
        private var _arenaEndSeconds:int;
        private var _leftTimeView1:LeftTimeView;
        private var _leftTimeView2:LeftTimeView;
        private var _matchWaitingTimeView:ArenaMatchWaitingView;
        private var _matchSecTimer:SecTimer;
        public static var HeroArenaLevel:int = 70;
        public static var HeroArenaBTopLevel:int;

        public function HeroArenaController()
        {
            this.initState();
            return;
        }// end function

        private function initState() : void
        {
            this._isInArena = false;
            this._isWatching = false;
            this._isArenaOpen = false;
            this._isArenaClose = true;
            this._isArenaBegin = false;
            this._isArenaEnd = false;
            this._isMatching = false;
            this._isMatchSucc = false;
            this._isObserver = false;
            this._isLimited = false;
            this._isNeedPopupSignUpWin = true;
            return;
        }// end function

        override protected function initServer() : void
        {
            Dispatcher.addEventListener(EventName.HeroArenaOpenMainWin, this.onOpenMainWinHandler);
            Dispatcher.addEventListener(EventName.HeroArenaOpenRestRoom, this.onOpenRestRoomWinHandler);
            Dispatcher.addEventListener(EventName.NavbarButtonUIRowInited, this.onInitIcon);
            Dispatcher.addEventListener(EventName.HeroArenaEnterRestRoom, this.onEnterRestRoom);
            Dispatcher.addEventListener(EventName.HeroArenaLeaveRestRoom, this.onLeaveRestRoom);
            Dispatcher.addEventListener(EventName.HeroArenaResetAllState, this.onResetAllState);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaGetTeamInvate, this.onGetTeamInvateHandler);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaGetTeamApply, this.onGetTeamApplyHandler);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaUpdateMyTeamInfo, this.onUpdateMyTeamInfoHandler);
            Dispatcher.addEventListener(EventName.HeroArenaOpenOrCloseMainWin, this.onOpenOrCloseMainWin);
            Dispatcher.addEventListener(EventName.HeroArenaOpenOrCloseEnterWin, this.onOpenOrCloseEnterWin);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaOpen, this.onArenaOpenHandler);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaClose, this.onArenaCloseHandler);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaMatchSucc, this.onMatchSuccHandler);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaEnterArena, this.onEnterArena);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaGetFightResult, this.onArenaResultShowHandler);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaSignUp, this.onArenaSignUpHandler);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaEnterAsObserver, this.onEnterArenaAsObserver);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaLeaveArena, this.onLeaveArenaHandler);
            NetDispatcher.addCmdListener(ServerCommand.RoleLevelUpdate, this.onLevelUpdateHandler);
            NetDispatcher.addCmdListener(ServerCommand.Copy_EnterCopy, this.onEnterCopyHandler);
            NetDispatcher.addCmdListener(ServerCommand.HeroArenaUpdateRewardInfo, this.onRewardUpdateHandler);
            Dispatcher.addEventListener(EventName.ShopMallOpenAndSelect, this.openArenaWin);
            Dispatcher.addEventListener(EventName.HeroArenaCancelSignUp, this.onCancelSignUpHandler);
            Dispatcher.addEventListener(EventName.HeroArenaEnterCopyOnMatch, this.enterCopyOnMatchHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicEntityKillerInfo, this.onSelfDeadHandler);
            return;
        }// end function

        override public function enterCopy(param1:TCopy) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.TaskShowHideTrackExceptBtn, false));
            return;
        }// end function

        private function onOpenOrCloseMainWin(event:DataEvent) : void
        {
            if (cache.role.entityInfo.level < GameConst.HeroArenaOpenLevel)
            {
                MsgManager.showRollTipsMsg(Language.getStringByParam(20408, GameConst.HeroArenaOpenLevel));
                return;
            }
            if (HeroArenaMainWin.instance.isHide)
            {
                HeroArenaMainWin.instance.show();
            }
            else
            {
                HeroArenaMainWin.instance.hide();
            }
            return;
        }// end function

        private function onOpenOrCloseEnterWin(event:DataEvent) : void
        {
            if (cache.role.entityInfo.level < GameConst.HeroArenaOpenLevel)
            {
                MsgManager.showRollTipsMsg(Language.getStringByParam(20408, GameConst.HeroArenaOpenLevel));
                return;
            }
            if (HeroArenaEnterWin.instance.isHide)
            {
                HeroArenaEnterWin.instance.show();
            }
            else
            {
                HeroArenaEnterWin.instance.hide();
            }
            return;
        }// end function

        private function onArenaOpenHandler(param1:SArenaOpen) : void
        {
            this.initState();
            this._isArenaOpen = true;
            this._isArenaClose = false;
            HeroArenaController.HeroArenaLevel = 70;
            cache.heroArena.updateArenaSettleDate(param1);
            if (param1)
            {
                this._arenaEndSeconds = param1.endSeconds;
            }
            if (cache.role.entityInfo.level >= GameConst.HeroArenaOpenLevel)
            {
                HeroArenaIcon.instance.show();
            }
            if (!this._secTimer)
            {
                this._secTimer = new SecTimer(1);
            }
            this._secTimer.reset();
            this._secTimer.start();
            this._secTimer.addListener(TimerType.ENTERFRAME, this.onTimeChange);
            return;
        }// end function

        private function onTimeChange(param1:SecTimer) : void
        {
            if (cache.role.entityInfo.level < GameConst.HeroArenaOpenLevel)
            {
                var _loc_4:String = this;
                var _loc_5:* = this._arenaEndSeconds - 1;
                _loc_4._arenaEndSeconds = _loc_5;
                return;
            }
            var _loc_2:* = ClockManager.instance.nowDate.time;
            var _loc_3:* = 1800 - 20;
            if (this._arenaEndSeconds > _loc_3)
            {
                HeroArenaIcon.instance.setLeftTimeAndState(this._arenaEndSeconds - _loc_3, 1);
                this._isArenaBegin = false;
            }
            else if (this._arenaEndSeconds > 0 && this._arenaEndSeconds <= _loc_3)
            {
                HeroArenaIcon.instance.setLeftTimeAndState(this._arenaEndSeconds, 2);
                HeroArenaIcon.instance.playEffect();
                if (this._isNeedPopupSignUpWin && cache.role.entityInfo.level >= GameConst.HeroArenaOpenLevel)
                {
                    if (!GameMapUtil.curMapState.isHeroArenaRestRoomMap)
                    {
                        HeroArenaEnterWin.instance.show();
                    }
                    else
                    {
                        HeroArenaMainWin.instance.show();
                    }
                    this._isNeedPopupSignUpWin = false;
                }
                if (!this._isArenaBegin)
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.HeroArenaBegin));
                }
                this._isArenaBegin = true;
            }
            else
            {
                this._isArenaEnd = true;
                if (this._secTimer)
                {
                    this._secTimer.stop();
                    this._secTimer.dispose();
                }
                HeroArenaIcon.instance.hide();
                Dispatcher.dispatchEvent(new DataEvent(EventName.HeroArenaEnd));
            }
            var _loc_4:String = this;
            var _loc_5:* = this._arenaEndSeconds - 1;
            _loc_4._arenaEndSeconds = _loc_5;
            return;
        }// end function

        private function onLevelUpdateHandler(param1:Object) : void
        {
            if (this._isArenaOpen && HeroArenaIcon.instance.isHide && cache.role.entityInfo.level >= GameConst.HeroArenaOpenLevel)
            {
                HeroArenaIcon.instance.show();
                if (!this._secTimer)
                {
                    this._secTimer = new SecTimer(1);
                }
                this._secTimer.reset();
                this._secTimer.start();
                this._secTimer.addListener(TimerType.ENTERFRAME, this.onTimeChange);
            }
            return;
        }// end function

        private function onArenaCloseHandler(param1:Object) : void
        {
            this.initState();
            if (HeroArenaIcon.hasInstance())
            {
                if (!cache.heroArena.hasRewardCanTake())
                {
                    HeroArenaIcon.instance.hide();
                }
            }
            if (HeroArenaMainWin.isViewShow())
            {
                HeroArenaMainWin.instance.hide();
            }
            if (HeroArenaEnterWin.isViewShow())
            {
                HeroArenaEnterWin.instance.hide();
            }
            if (HeroArenaResultWin.isViewShow())
            {
                HeroArenaResultWin.instance.hide();
            }
            if (!GameMapUtil.curMapState.isHeroArenaMap)
            {
                if (this._leftTimeView1)
                {
                    this._leftTimeView1.dispose();
                    this._leftTimeView1 = null;
                }
                if (this._leftTimeView2)
                {
                    this._leftTimeView2.dispose();
                    this._leftTimeView2 = null;
                }
            }
            if (HeroArenaMatchWaitingView.isViewShow())
            {
                HeroArenaMatchWaitingView.instance.hide();
            }
            return;
        }// end function

        private function onMatchSuccHandler(param1:SArenaMatch) : void
        {
            var onCloseHandler:Function;
            var sArenaMatch:* = param1;
            onCloseHandler = function () : void
            {
                if (_matchSecTimer.currentCount < 9)
                {
                    GameProxy.copy.enterArena(sArenaMatch.arenaId);
                }
                _matchSecTimer.stop();
                return;
            }// end function
            ;
            this._isMatching = false;
            this._isMatchSucc = true;
            if (HeroArenaMatchWaitingView.isViewShow())
            {
                HeroArenaMatchWaitingView.instance.hide();
            }
            GameMapUtil.isCanMoveOnClickMap = false;
            HeroArenaTimerWin.instance.show();
            HeroArenaTimerWin.instance.timeOutFunc = onCloseHandler;
            var nowTime1:* = ClockManager.instance.nowDate.time / 1000;
            if (this._matchSecTimer == null)
            {
                this._matchSecTimer = new SecTimer();
            }
            this._matchSecTimer.reset();
            this._matchSecTimer.start();
            return;
        }// end function

        private function onEnterArena(param1:int) : void
        {
            if (!this._isInArena)
            {
                this._isInArena = true;
                this.doDisableAfterEnterArena();
                RolePlayer.instance.updateName(NameUtil.getProxyName(cache.role.entityInfo.entityId));
                if (HeroArenaMainWin.isViewShow())
                {
                    HeroArenaMainWin.instance.hide();
                }
                if (HeroArenaResultWin.isViewShow())
                {
                    HeroArenaResultWin.instance.hide();
                }
                Alert.removeAllAlertWin();
                if (!this._leftTimeView1)
                {
                    this._leftTimeView1 = UICompomentPool.getUICompoment(LeftTimeView);
                    this._leftTimeView1.tfLeftTime.timeOutHandler = this.onArenaCompetitionBegin;
                    this._leftTimeView1.setCenterPosition();
                    this._leftTimeView1.setParse(Language.getString(20409));
                }
                this._leftTimeView1.updateLeftTime(param1);
                this._leftTimeView1.show();
                if (SystemSetting.instance.hideSetter.displayValue)
                {
                    SystemSetting.instance.hideSetter.displayValue = 0;
                    SystemSetting.instance.updateToServer();
                    SystemSetting.instance.save();
                }
            }
            return;
        }// end function

        private function onEnterCopyHandler(param1:Object) : void
        {
            if (cache.copy.copyInfo.type != ECopyType._ECopyTypeArena2v2)
            {
                if (this._isMatching)
                {
                    this._isMatching = false;
                    this._isMatchSucc = false;
                    if (HeroArenaMainWin.isViewShow())
                    {
                        HeroArenaMainWin.instance.hide();
                    }
                    if (HeroArenaMatchWaitingView.isViewShow())
                    {
                        HeroArenaMatchWaitingView.instance.hide();
                    }
                }
                if (!HeroArenaTimerWin.instance.isHide)
                {
                    HeroArenaTimerWin.instance.hide();
                    this._isMatchSucc = false;
                }
            }
            return;
        }// end function

        private function enterCopyOnMatchHandler(event:DataEvent) : void
        {
            var data:GroupCopyLeaveOperData;
            var onEnterCopy:Function;
            var e:* = event;
            onEnterCopy = function (param1:int) : void
            {
                if (param1 == Alert.YES)
                {
                    if (_isMatching)
                    {
                        _isMatching = false;
                        _isMatchSucc = false;
                        if (HeroArenaMatchWaitingView.isViewShow())
                        {
                            HeroArenaMatchWaitingView.instance.hide();
                        }
                    }
                    if (_isMatchSucc)
                    {
                        _isMatchSucc = false;
                        HeroArenaTimerWin.instance.hide();
                    }
                    if (HeroArenaMainWin.isViewShow())
                    {
                        HeroArenaMainWin.instance.hide();
                    }
                    if (data.prame.length > 0)
                    {
                        data.callBack.call(null, data.prame[0]);
                    }
                }
                return;
            }// end function
            ;
            data = e.data as GroupCopyLeaveOperData;
            Alert.show(Language.getString(20410), null, Alert.YES | Alert.NO, null, onEnterCopy);
            return;
        }// end function

        private function doDisableAfterEnterArena() : void
        {
            this._isLimited = true;
            Dispatcher.dispatchEvent(new DataEvent(EventName.GroupAvatarVisible, false));
            Dispatcher.dispatchEvent(new DataEvent(EventName.SkillClearAllCD));
            Dispatcher.dispatchEvent(new DataEvent(EventName.InstantBackMedicineCDClear, [EDrug._EDrugLifeBag]));
            TaskDramaMouseKeyboardControl.enablePlayerOp = false;
            cache.skill.needDisableUseSkill = true;
            AIManager.cancelAll();
            RolePlayer.instance.stopMove();
            this.isNeedHideUI(true);
            if (MountUtil.isRideUp)
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.MountRide));
            }
            return;
        }// end function

        private function removeLimitAfterLeaveArena() : void
        {
            if (this._isLimited)
            {
                this._isLimited = false;
                Dispatcher.dispatchEvent(new DataEvent(EventName.GroupAvatarVisible, true));
                TaskDramaMouseKeyboardControl.enablePlayerOp = true;
                cache.skill.needDisableUseSkill = false;
                GameMapUtil.isCanMoveOnClickMap = true;
                this.isNeedHideUI(false);
            }
            return;
        }// end function

        private function isNeedHideUI(param1:Boolean) : void
        {
            if (param1)
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.ActionIconOpenClose, false));
                cache.best.copyBestViewClose = true;
                Dispatcher.dispatchEvent(new DataEvent(EventName.BestViewOpenClose));
                Dispatcher.dispatchEvent(new DataEvent(EventName.TaskShowHideTrackExceptBtn, false));
            }
            else
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.ActionIconOpenClose, true));
                cache.best.copyBestViewClose = false;
                Dispatcher.dispatchEvent(new DataEvent(EventName.BestViewOpenClose));
                Dispatcher.dispatchEvent(new DataEvent(EventName.TaskShowHideTrackExceptBtn, true));
            }
            return;
        }// end function

        private function onArenaCompetitionBegin() : void
        {
            TaskDramaMouseKeyboardControl.enablePlayerOp = true;
            cache.skill.needDisableUseSkill = false;
            GameMapUtil.isCanMoveOnClickMap = true;
            this._leftTimeView1.hide();
            this.showCompetitionTime(ArenaConst.Arena_Last_Time * 60);
            if (!HeroArenaFightDetailWin.isViewShow())
            {
                HeroArenaUtil.isObserverModel = false;
                HeroArenaFightDetailWin.instance.show();
            }
            if (HeroArenaFightDetailWin.isViewShow())
            {
                HeroArenaFightDetailWin.instance.setLeftTime(ArenaConst.Arena_Last_Time * 60);
            }
            return;
        }// end function

        private function showCompetitionTime(param1:int) : void
        {
            if (!this._leftTimeView2)
            {
                this._leftTimeView2 = UICompomentPool.getUICompoment(LeftTimeView);
                if (Global.isDebugModle)
                {
                    this._leftTimeView2.setParse(Language.getString(20411));
                }
                else
                {
                    this._leftTimeView2.setParse(Language.getString(20409));
                }
            }
            this._leftTimeView2.updateLeftTime(param1);
            this._leftTimeView2.show();
            return;
        }// end function

        private function onArenaResultShowHandler(param1:SArenaPlayerResult) : void
        {
            if (this._alertWin && this._alertWin.parent)
            {
                DisplayUtil.removeMe(this._alertWin);
            }
            HeroArenaResultWin.instance.show();
            HeroArenaResultWin.instance.updateArenaResult();
            return;
        }// end function

        private function onEnterArenaAsObserver(param1:int) : void
        {
            this._isWatching = true;
            this.showCompetitionTime(param1);
            if (!RolePlayer.instance.entityInfo)
            {
                if (!this._frameTimer)
                {
                    this._frameTimer = new FrameTimer(1, int.MAX_VALUE, true);
                    this._frameTimer.addListener(TimerType.ENTERFRAME, this.onPlayerInitOk);
                }
                this._frameTimer.start();
            }
            else
            {
                this.changeToObserver();
            }
            return;
        }// end function

        private function onPlayerInitOk(param1:FrameTimer) : void
        {
            if (Game.isSceneInit())
            {
                this._frameTimer.stop();
                this.changeToObserver();
            }
            return;
        }// end function

        private function changeToObserver() : void
        {
            RolePlayer.instance.entityInfo.isDisappear = true;
            RolePlayer.instance.entityInfo.isUpdateDisappear = true;
            RolePlayer.instance.entityInfo.isUpdate = true;
            cache.skill.needDisableUseSkill = true;
            KeyBoardManager.instance.cancelListener();
            if (HeroArenaMainWin.isViewShow())
            {
                HeroArenaMainWin.instance.hide();
            }
            if (HeroArenaResultWin.isViewShow())
            {
                HeroArenaResultWin.instance.hide();
            }
            this._isLimited = true;
            this.isNeedHideUI(true);
            return;
        }// end function

        override public function leaveCopy() : void
        {
            this.removeLimitAfterLeaveArena();
            this.onLeaveArenaHandler();
            if (this._leftTimeView1)
            {
                this._leftTimeView1.dispose();
                this._leftTimeView1 = null;
            }
            if (this._leftTimeView2)
            {
                this._leftTimeView2.dispose();
                this._leftTimeView2 = null;
            }
            return;
        }// end function

        private function onLeaveArenaHandler(param1:Object = null) : void
        {
            this._isInArena = false;
            this._isWatching = false;
            this._isMatching = false;
            this._isMatchSucc = false;
            if (Game.isSceneInit())
            {
                RolePlayer.instance.entityInfo.isDisappear = false;
                RolePlayer.instance.entityInfo.isUpdateDisappear = true;
                RolePlayer.instance.entityInfo.isUpdate = true;
            }
            if (this._leftTimeView1)
            {
                this._leftTimeView1.dispose();
                this._leftTimeView1 = null;
            }
            if (this._leftTimeView2)
            {
                this._leftTimeView2.dispose();
                this._leftTimeView2 = null;
            }
            if (HeroArenaFightDetailWin.isViewShow())
            {
                HeroArenaFightDetailWin.instance.hide();
            }
            this.removeLimitAfterLeaveArena();
            if (this._isArenaBegin && !this._isArenaEnd && !HeroArenaMainWin.isViewShow())
            {
                if (!GameMapUtil.curMapState.isHeroArenaRestRoomMap)
                {
                }
                else
                {
                    HeroArenaMainWin.instance.show();
                }
            }
            return;
        }// end function

        private function onArenaSignUpHandler(param1:Object) : void
        {
            var _loc_2:* = param1 as SArenaSignUpState;
            if (_loc_2.isCancel)
            {
                this._isMatching = false;
                if (HeroArenaMatchWaitingView.isViewShow())
                {
                    HeroArenaMatchWaitingView.instance.hide();
                }
            }
            else
            {
                this._isMatching = true;
                HeroArenaMatchWaitingView.instance.show();
                HeroArenaMatchWaitingView.instance.startCount();
            }
            return;
        }// end function

        private function openArenaWin(event:DataEvent) : void
        {
            var _loc_2:* = event.data as String;
            if (_loc_2 == "show me the heroArena")
            {
                HeroArenaMainWin.instance.show();
            }
            return;
        }// end function

        private function onCancelSignUpHandler(event:DataEvent = null) : void
        {
            var _loc_2:* = new EArenaMode(EArenaMode._EArenaOneVsMulti);
            GameProxy.copy.signUpArena(ECopyType._ECopyTypeArena2v2, true, _loc_2);
            return;
        }// end function

        private function onRewardUpdateHandler(param1:Object) : void
        {
            if (cache.heroArena.hasRewardCanTake())
            {
                if (HeroArenaIcon.instance.isHide)
                {
                    HeroArenaIcon.instance.show();
                }
                HeroArenaIcon.instance.playEffect();
            }
            else if (!HeroArenaIcon.instance.isHide)
            {
                HeroArenaIcon.instance.stopEffect();
                if (!this._isArenaOpen || this._isArenaClose)
                {
                    HeroArenaIcon.instance.hide();
                }
            }
            return;
        }// end function

        private function onInitIcon(event:DataEvent) : void
        {
            if (Global.isDebugModle)
            {
                if (cache.role.entityInfo.level >= GameConst.HeroArenaOpenLevel)
                {
                    HeroArenaIcon.instance.show();
                }
            }
            return;
        }// end function

        private function onOpenMainWinHandler(event:DataEvent) : void
        {
            HeroArenaMainWin.instance.show();
            return;
        }// end function

        private function onOpenRestRoomWinHandler(event:DataEvent) : void
        {
            HeroArenaEnterWin.instance.show();
            return;
        }// end function

        private function onEnterRestRoom(event:DataEvent) : void
        {
            GameProxy.copy.enterRestRoom();
            return;
        }// end function

        private function onLeaveRestRoom(event:DataEvent) : void
        {
            GameProxy.copy.leftResetRoom();
            return;
        }// end function

        private function onGetTeamInvateHandler(param1:Object) : void
        {
            var _loc_2:* = cache.heroArena.myTeamInfo;
            if (!_loc_2 && !HeroArenaInvateResponseWin.isViewShow())
            {
                HeroArenaInvateSmallIcon.instance.show();
            }
            return;
        }// end function

        private function onGetTeamApplyHandler(param1:Object) : void
        {
            var _loc_2:* = cache.heroArena.myTeamInfo;
            if (_loc_2 && !HeroArenaApplyResponseWin.isViewShow())
            {
                HeroArenaApplySmallIcon.instance.show();
            }
            return;
        }// end function

        private function onUpdateMyTeamInfoHandler(param1:Object) : void
        {
            var _loc_2:* = cache.heroArena.myTeamInfo;
            if (_loc_2)
            {
                if (HeroArenaTeamGroupWin.isViewShow())
                {
                    HeroArenaTeamGroupWin.instance.hide();
                }
                if (HeroArenaTeamInvateWin.isViewShow())
                {
                    HeroArenaTeamInvateWin.instance.hide();
                }
            }
            return;
        }// end function

        private function onSelfDeadHandler(param1:MessageBlock) : void
        {
            if (GameMapUtil.curMapState.isHeroArenaMap)
            {
                MsgManager.showTaskTarget(Language.getString(20412), 1);
            }
            return;
        }// end function

        private function onResetAllState(event:DataEvent) : void
        {
            this.initState();
            return;
        }// end function

        public function get isArenaBegin() : Boolean
        {
            return this._isArenaBegin;
        }// end function

        public function get isArenaEnd() : Boolean
        {
            return this._isArenaEnd;
        }// end function

        public function get isInArena() : Boolean
        {
            return this._isInArena;
        }// end function

        public function get isWatching() : Boolean
        {
            return this._isWatching;
        }// end function

        public function get isArenaOpen() : Boolean
        {
            return this._isArenaOpen;
        }// end function

        public function get isArenaClose() : Boolean
        {
            return this._isArenaClose;
        }// end function

        public function get isMatching() : Boolean
        {
            return this._isMatching;
        }// end function

        public function get isMatchSucc() : Boolean
        {
            return this._isMatchSucc;
        }// end function

        public function get isInCountDown() : Boolean
        {
            if (this._leftTimeView1)
            {
                return this._leftTimeView1.running;
            }
            return false;
        }// end function

    }
}
